package com.sample.springbatch.job.sample.processor;

import com.sample.springbatch.model.HbBillLoanDetailEntity;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.stereotype.Component;

import java.sql.Timestamp;
import java.util.Date;

/**
 * Created by zwg on 2017/7/20.
 */
@Component
public class HbBillLoanDetailProcessor implements ItemProcessor<HbBillLoanDetailEntity,HbBillLoanDetailEntity> {

    private static final Logger log = LoggerFactory.getLogger(HbBillLoanDetailProcessor.class);

    @Override
    public HbBillLoanDetailEntity process(final HbBillLoanDetailEntity entity) throws Exception {

        //log.info("HbBillLoanDetailEntity :{}",entity);
        entity.setCreateTime(new Timestamp(System.currentTimeMillis()));
        //TODO 业务日期 setBusinessDate(dateUtils.getPreBusinessDate(CcConstants.DEFAULT_ORG_ID));
        entity.setBusinessDate(new Date());
        return entity;
    }
}
